package br.com.sgs.persist;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author MaUrO FiLhO
 */
@Entity
@javax.persistence.SequenceGenerator(name="seqfornecedor_id_seqfornecedor_seq", sequenceName="seqfornecedor_id_seqfornecedor_seq")
@Table(name = "seqfornecedor")
@NamedQueries({
    @NamedQuery(name = "Seqfornecedor.findAll", query = "SELECT s FROM Seqfornecedor s"),
    @NamedQuery(name = "Seqfornecedor.findByIdSeqfornecedor", query = "SELECT s FROM Seqfornecedor s WHERE s.idSeqfornecedor = :idSeqfornecedor")})
public class Seqfornecedor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator="seqfornecedor_id_seqfornecedor_seq")
    @Basic(optional = false)
    @Column(name = "id_seqfornecedor")
    private Integer idSeqfornecedor;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "seqfornecedor")
    private Fornecedor fornecedor;

    public Seqfornecedor() {
    }

    public Seqfornecedor(Integer idSeqfornecedor) {
        this.idSeqfornecedor = idSeqfornecedor;
    }

    public Integer getIdSeqfornecedor() {
        return idSeqfornecedor;
    }

    public void setIdSeqfornecedor(Integer idSeqfornecedor) {
        this.idSeqfornecedor = idSeqfornecedor;
    }

    public Fornecedor getFornecedor() {
        return fornecedor;
    }

    public void setFornecedor(Fornecedor fornecedor) {
        this.fornecedor = fornecedor;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSeqfornecedor != null ? idSeqfornecedor.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Seqfornecedor)) {
            return false;
        }
        Seqfornecedor other = (Seqfornecedor) object;
        if ((this.idSeqfornecedor == null && other.idSeqfornecedor != null) || (this.idSeqfornecedor != null && !this.idSeqfornecedor.equals(other.idSeqfornecedor))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.sgs.persist.Seqfornecedor[idSeqfornecedor=" + idSeqfornecedor + "]";
    }

}
